<?php
/**
 * Created by 长毋相忘c.
 * 文件用途描述 :
 * Date: 2018/2/12/012
 * Time: 0:13
 */

namespace app\api\controller\v1;


use app\api\model\Category;
use app\lib\exception\CategoryException;
class CategoryController
{
    public function getAllCategories(){
        //all代表查询所有数据 为空【】表示查询所有
        $categories=Category::all([],'img');
        if(!$categories){
            throw new CategoryException();
        }
        return $categories;
    }

}